package com.hrt.datasender.datacollect.drive.text;

import com.btcode.common.MyLog;
import com.btcode.log.ILog;
import com.hrt.datasender.datacollect.drive.DriveConfigModel;
import com.hrt.datasender.datacollect.drive.DriveTimer;
import com.hrt.datasender.datadao.model.BcDevicesModel;
import com.hrt.datasender.mq.MqKit;
import com.hrt.datasender.mq.model.SerialModel;

import java.util.HashMap;

/**
 * 中兴协议询问器
 * 
 * @author 张文成
 *
 */
public class ZeeiDriveAsker extends DriveTimer {
    // 客户端发送Z0GRESULT

    private ILog log = null;

    @Override
    public void executeTimer(DriveConfigModel configs, BcDevicesModel deviceData) {

        try {
            log = MyLog.getInstance().getLogger(getClass().getName() + "." + deviceData.getDeviceName());
            String askMsg = "Z0GRESULT";
            SerialModel askModel = new SerialModel(askMsg.getBytes(), deviceData.getComNum(), "");
            MqKit.productAskDataMsgToSerialMQ(askModel);
            log.info("中兴驱动发起串口询问："+askMsg);
        } 
        catch (Exception e) {
            log.error("执行定时任务出错", e);
        }

    }
}
